package com.complex.spring.advance.aop.cglib.sample;

import java.lang.reflect.Method;

import net.sf.cglib.proxy.MethodInterceptor;
import net.sf.cglib.proxy.MethodProxy;

/**
 * 与动态代理相似的一个handler,称为callback
 * @author gao
 *
 */
public class RequestCtrlCallback implements MethodInterceptor{

	@Override
	public Object intercept(Object obj, Method method, Object[] args,
			MethodProxy proxy) throws Throwable {
		if(method.getName().equals("request")){
			System.out.println("处理切入逻辑");
		}
		return proxy.invoke(obj, args);
	}
}
